import { sendRequest } from '@/http';

/**
 * 获取服务分类列表
 */
export function getServiceCategories(params: any) {
  return sendRequest({
    url: `/serviceCategory/list`,
    method: 'get',
    params,
  });
}

/**
 * 新增服务分类
 */
export function addServiceCategory(data: any) {
  return sendRequest({
    url: `/serviceCategory/add`,
    method: 'post',
    data,
  });
}

/**
 * 编辑服务分类
 */
export function updateServiceCategory(data: any) {
  return sendRequest({
    url: `/serviceCategory/update`,
    method: 'post',
    data,
  });
}

/**
 * 删除服务分类
 */
export function deleteServiceCategory(categoryId: string) {
  return sendRequest({
    url: `/serviceCategory/delete`,
    method: 'post',
    data: { categoryId },
  });
}

/**
 * 获取上级分类列表（用于下拉选择）
 */
export function getParentCategories() {
  return sendRequest({
    url: `/serviceCategory/parentList`,
    method: 'get',
  });
}
